
use WebSecurity;
GO
-- Drop stored procedure if it already exists
IF EXISTS (
  SELECT * 
    FROM INFORMATION_SCHEMA.ROUTINES 
   WHERE SPECIFIC_CATALOG = N'WebSecurity' 
	 AND SPECIFIC_SCHEMA = N'dbo'
     AND SPECIFIC_NAME = N'DomainName_del' 
)
   DROP PROCEDURE dbo.DomainName_del
GO
create procedure DomainName_del
	@DomainNameID Int,
	@TS varbinary(8),	@RowsAffected int = null OUTPUT 
	
--*************************************************************
--Created By: trooks
--Name: dbo_DomainName_del
--Table: DomainName
--Database: WebSecurity
--Created Date: 01/21/2013 00:00:00
--*************************************************************

as
	Begin Try
		Delete From [dbo].DomainName
		 where
		 @DomainNameID = DomainNameID
		AND @TS = TS

		Set @RowsAffected = @@ROWCOUNT;
		return 0;	
	END TRY
	BEGIN CATCH
		Set @RowsAffected = 0;
		EXEC dbo.uspLogError;
		return -1;
	END CATCH
	
GO
GRANT EXECUTE ON [WebSecurity].[dbo].[DomainName_del] to PORTAL_WebSecurity
GO
